package edu.sctu.practice.class02.qiuyangyang.assign02;

/**
 * Created by Administrator on 2015/10/8 0008.
 */
public class Circle {
    private double radius;
    public double square;
    private static int numOfObjects = 0;
    public  final double  PI=3.14;

    public Circle(double radius) {
        this.radius = radius;
        numOfObjects++;
    }

    public double getSquare() {
        square = PI * radius * radius;
        return square;
    }

    public static int getNumOfObjects() {
        return numOfObjects;
    }


    public static void printCircle(Circle c) {
        System.out.println(c.radius);
        System.out.println(c.square);


    }

    public static void main(String[] args) {
        Circle print = new Circle(2.2);

        System.out.println("圆1的半径为：" + print.radius);
        System.out.println("圆1的面积为:" + print.getSquare());


        Circle put = new Circle(3.3);

        System.out.println("圆2的半径为：" + put.radius);
        System.out.println("圆2的面积为:" + put.getSquare());
        System.out.println("计数为:" + Circle.getNumOfObjects());
    }

}
